import request from './request.js';
let service = request.service;
let formatterUrl = request.formatterUrl;
export default {
  PEList(data) {
    return service({
      /**PE知识库列表 */
      url: `/adscm/pebase/peDiseaseType/select`,
      method: 'post',
      data,
    })
  },
  userList() {
    return service({
      /**PE知识库创建人列表 */
      url: `/adscm/pebase/peDiseaseType/selectUsers`,
      method: 'get'
    })
  },
  PEList(data) {
    return service({
      /**PE知识库列表 */
      url: `/adscm/pebase/peDiseaseType/select`,
      method: 'post',
      data,
    })
  },
  addUpdatePeDisease(type, data) {
    return service({
      /**新增修改PE知识库 */
      url: `/adscm/pebase/peDiseaseType/${type}`, //type: insert-新增PE知识库 update-修改pe知识库
      method: 'post',
      data
    })
  },
  deletePeDisease(id) {
    return service({
      url: `/adscm/pebase/peDiseaseType/delete/${id}`,
      /**删除PE知识库 */
      method: 'post'
    })
  },
  peDocument(data) {
    return service({
      url: `/adscm/pebase/peDocument/insert`,
      /**原文献上传*/
      method: 'post',
      data
    }, 'upload')
  },
  updatePeDocument(data) {
    /**原文献修改*/
    return service({
      url: `/adscm/pebase/peDocument/update`,

      method: 'post',
      data
    })
  },
  literatureList(data) {
    return service({
      url: `/adscm/pebase/peDocument/selectByDid`,
      /**获取文献列表 */
      method: 'post',
      data
    })
  },
  literatureListByLabels(data) {
    return service({
      url: `/adscm/pebase/peDocumentLabel/selectDocumentByLabels`,
      /**根据标签查询原文献列表 */
      method: 'post',
      data
    })
  },
  deteleLiterature(id) {
    return service({
      url: `/adscm/pebase/peDocument/delete/${id}`,
      /**删除文献*/
      method: 'post'
    })
  },
  literatureDownload(id) { //原文献下载
    return formatterUrl({
      url: `/adscm/pebase/peDocument/download/${id}`
    })
  },
  abstractList(data) {
    /**文献摘要列表*/
    return service({
      url: `/adscm/pebase/peAbstractContent/selectByDid`,
      method: 'post',
      data
    })
  },
  addAbstract(type, data) {
    /**新增或修改文献摘要*/
    return service({
      url: `/adscm/pebase/peAbstractContent/${type}`,
      method: 'post',
      data
    })
  },
  deleteAbstract(id) {
    return service({
      url: `/adscm/pebase/peAbstractContent/delete/${id}`,
      /**删除文献摘要*/
      method: 'post'
    })
  },
  /**摘要关联文献接口 */
  contentAbstractInfo(data) {
    return service({
      url: `/adscm/pebase/peDocumentAbstract/insert`,
      method: 'post',
      data
    })
  },

  /**摘要关联文献列表接口 */
  abstractInfoList(aid) {
    return service({
      url: `/adscm/pebase/peDocumentAbstract/selectDocumentByAid/${aid}`,
      method: 'post',
    })
  },
  deleteAbstractLiterature(id) {
    return service({
      url: `/adscm/pebase/peDocumentAbstract/delete/${id}`,
      /**摘要文献删除关联文献*/
      method: 'post'
    })
  },
  /**标签关联接口 */
  tagList() {
    return service({
      url: `/adscm/pebase/peLabel/select`,
      /**获取标签列表*/
      method: 'post'
    })
  },
  addUpdateTag(type, data) {
    return service({
      url: `/adscm/pebase/peLabel/${type}`,
      /**新增或修改标签 insert-新增，update-修改*/
      method: 'post',
      data
    })
  },
  tagDelete(id) {
    return service({
      url: `/adscm/pebase/peLabel/delete/${id}`,
      /**获取所有标签列表*/
      method: 'post'
    })
  },
  addRelationTag(data) {
    return service({
      url: `/adscm/pebase/peDocumentLabel/insert`,
      /**原文献新增关联标签*/
      method: 'post',
      data
    })
  },
  relationTagList(did) {
    return service({
      url: `/adscm/pebase/peDocumentLabel/selectLabelsByDid/${did}`,
      /**根据原文献id获取已关联标签列表*/
      method: 'post'
    })
  },
  deteteRelationTag(id) {
    return service({
      url: `/adscm/pebase/peDocumentLabel/delete/${id}`,
      /**解除已关联标签*/
      method: 'post'
    })
  },
  pePptList(did) {
    /**ppt资料列表*/
    return service({
      url: `/adscm/pebase/peAttachment/selectByDid/${did}`,
      method: 'post'
    })
  },
  deletePePpt(id) {
    /**ppt资料删除*/
    return service({
      url: `/adscm/pebase/peAttachment/delete/${id}`,
      method: 'post'
    })
  },
  pePptUpload(data) {
    /**ppt资料上传*/
    return service({
      url: `/adscm/pebase/peAttachment/upload`,
      method: 'post',
      data
    }, 'upload')
  },
  pptDowload(id) {
    /**ppt下载接口 */
    return formatterUrl({
      url: `/adscm/pebase/peAttachment/download/${id}`
    })
  },
  pePictureList(id) {
    /**图片集列表*/
    return service({
      url: `/adscm/pebase/pePicture/selectByDid/${id}`,
      method: 'post'
    })
  },
  deletePePicture(id) {
    /**删除图片集*/
    return service({
      url: `/adscm/pebase/pePicture/delete/${id}`,
      method: 'post'
    })
  },
  addPePicture(data) {
    /**图片集*/
    return service({
      url: `/adscm/pebase/pePicture/insert`,
      method: 'post',
      data
    })
  },
  addUpdatePeApplyHistory(type, data) {
    /**新增修改pe摘要内容*/
    return service({
      url: `/adscm/pebase/peApplyHistory/${type}`,
      method: 'post',
      data
    })
  },
  peApplyHistoryList(id) {
    /**pe摘要内容修改列表*/
    return service({
      url: `/adscm/pebase/peApplyHistory/selectByPid/${id}`,
      method: 'post'
    })
  }
}